<template>
	<view>
		<view class="navBar-class">
			<tn-button style="color: black;width: 35px; height: 35px; font-size: 15px;" :border="false"
				@click="handleReturn">
				<text class="tn-icon-left"></text></tn-button>
			<view style="font-size: 15px;margin-right: 42%;">我的关注</view>
		</view>
		<view>
			<block v-for="(item, index) in followinglist" :key="index">
				<tn-list-cell :unlined="true" style="margin-top: 10px; border-radius: 15px;">
					<view class="chat-bar">
						<tn-avatar :src="item.followingAvatar" size="lg"/>
						<view class="information-bar">
							<text>{{item.followingName}}</text>
						</view>
						<!-- <view>
							<tn-button :fontSize="22" height="100%" shape="round" @click=""
								backgroundColor="#F8F8F8">已关注</tn-button>
						</view> -->
					</view>
				</tn-list-cell>
			</block>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				followinglist: []
			}
		},
		mounted() {
			this.getfollowing()
		},
		methods: {
			handleReturn() {
				uni.navigateBack({
					delta: 1
				});
			},

			getfollowing() {
				const userInfo = uni.getStorageSync('userInfo');
				uni.request({
					url: `${this.baseUrl}/wx/follow/followings/${userInfo.id}`,
					method: 'GET',
					success: (res) => {
						console.log(res);
						this.followinglist = res.data.data;
					}
				});
			}
		}
	}
</script>

<style>
	.navBar-class {
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin-top: 8%;
		height: auto;
	}

	.chat-bar {
		display: flex;
		flex-direction: row
	}

	.information-bar {
		display: flex;
		flex-direction: column;
		margin-left: 5px;
	}
</style>